package com.flaskpy.web.eternity.auth.jwt.service;

import com.flaskpy.web.eternity.auth.jwt.entiry.JwtPayLoad;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * @className: IOnLineService
 * @description: token续约服务
 * @author: flaskpy 代码copy大师
 * @date: 2021/6/9
 **/
public interface IOnLineService {

    /**
     * token有效期限检查
     * @param token
     * @return 是否有效
     */
    boolean checkNonExpires(String token);
    /**
     * token 生命延长
     * @param token
     */
    void renewal(String token, Authentication authentication);

    /**
     * 删除这个token
     * @param token
     */
    void logout(String token);

    /**
     * 用户登陆
     * @param token
     * @param authentication
     */
    void login(String token, Authentication authentication);
}
